package com.azhoucode.controller;

import com.azhoucode.common.SimpleResponse;
import com.azhoucode.entity.TableEntity;
import com.azhoucode.service.TableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: 数据库表接口层
 * @author: azhou
 * @create: 2021-12-15 10:50
 **/
@RestController
@RequestMapping("/table")
public class TableController {

    @Autowired
    private TableService tableService;


    /**
     * 添加单表配置
     * info#management#message#question#test_paper#type
     * @param tableEntity
     * @return
     */
    @PostMapping("/{random}")
    public SimpleResponse<String> addTableConfiguration(@RequestBody TableEntity tableEntity,@PathVariable("random") String random) throws Exception {
        tableService.addTableConfiguration(tableEntity,random);
        return SimpleResponse.success();
    }

}
